#include<cstdio>
#include<iostream>
#include<cstring>
 
using namespace std;

int Symbol(char s)
{
	if(s==' ' || s==',' || s=='.' || s=='!')
	return 1;
	else return 0;
}

void Sepsentence (char s[])
{
	int i = 0;
	while (s[i] != '\0')
	{
		while (Symbol(s[i]) == 1 && s[i] != '\0')
		    i++;
		int si = i;
		while (Symbol(s[i]) == 0 && s[i] != '\0')
		    i++;
		int ei = i-1;
		for (int j = si;j <= ei;j++)
		cout<<s[j];
		cout<<" ";
   }
}

int main()
{
	int i = 0;
	char s[100];
	cout<<"Input:";
	gets(s);
	cout<<"Output:";
	Sepsentence(s);
	return 0;
}




